package com.javasm.springmybatis.controller;

import com.javasm.springmybatis.task.AsyncTask;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping(value = "/async")
public class AsyncTaskController {
    private final static Logger LOG = LoggerFactory.getLogger(AsyncTaskController.class);
    @Resource
    private AsyncTask asyncTask;


    @GetMapping(value = "/test")
    public Object test() {
        asyncTask.register();
        LOG.info("主线程结束");
        return "OK";
    }
}
